<?php 
/* import database connection variables */
require_once __DIR__ . '/db_config.php';

if(!$db){    echo "Purcase DB! :p";    exit();}
$propinsi = $_GET['propinsi'];
if($propinsi==""){	
	$datas2 = array("success"=>0, "message"=>"Required field(s) is missing");	
	$json_format = json_encode($datas2);	
	echo $json_format;	
}else{	
	$datas = array();	
	$get = mysql_query("SELECT * FROM ekspedisi WHERE propinsi='".$propinsi."'");	
	$show = array();	
	while($k=mysql_fetch_array($get)){	
		$show[] = array( 
			"id_ekspedisi"=>$k["id_ekspedisi"],
			"propinsi"=>$k["propinsi"], 
			"kota"=>$k["kota"],
			"harga"=>$k["harga"]);
	}	
	$datas2 = array("success"=>1, "daftar_kota" => $show);	
	$json_format = json_encode($datas2);	
	echo $json_format;
}
?>